// Copyright (c) Microsoft Corporation.  All rights reserved.

#include "stdafx.h"
#include "D3D10EffectType.h"

#include "D3D10EffectType.h"
using namespace Microsoft::WindowsAPICodePack::DirectX::Direct3D10;
using namespace msclr::interop;


void EffectType::GetDescription(EffectTypeDescription^ Description)
{
    CommonUtils::VerifyResult(GetInterface<ID3D10EffectType>()->GetDesc(Description->nativeObject.Get()));
}

String^ EffectType::GetMemberName(UInt32 index)
{
    LPCSTR returnValue = GetInterface<ID3D10EffectType>()->GetMemberName(static_cast<UINT>(index));
    return gcnew String(returnValue);
}

String^ EffectType::GetMemberSemantic(UInt32 index)
{
    LPCSTR returnValue = GetInterface<ID3D10EffectType>()->GetMemberSemantic(static_cast<UINT>(index));
    return gcnew String(returnValue);
}

EffectType^ EffectType::GetMemberTypeByIndex(UInt32 index)
{
    ID3D10EffectType* returnValue = GetInterface<ID3D10EffectType>()->GetMemberTypeByIndex(static_cast<UINT>(index));
    return gcnew EffectType(returnValue);
}

EffectType^ EffectType::GetMemberTypeByName(String^ name)
{
    marshal_context^ context = gcnew marshal_context();
    ID3D10EffectType* returnValue = GetInterface<ID3D10EffectType>()->GetMemberTypeByName(context->marshal_as<const char*>(name));
    return gcnew EffectType(returnValue);
}

EffectType^ EffectType::GetMemberTypeBySemantic(String^ semantic)
{
    marshal_context^ context = gcnew marshal_context();
    ID3D10EffectType* returnValue = GetInterface<ID3D10EffectType>()->GetMemberTypeBySemantic(context->marshal_as<const char*>(semantic));
    return gcnew EffectType(returnValue);
}

Boolean EffectType::IsValid::get()
{
    return GetInterface<ID3D10EffectType>()->IsValid() != 0;
}

